<template>
  <div class="app-status-tags">
    <a-tag v-if="showType" :color="getTypeColor(app.codeGenType)">
      {{ getCodeGenTypeName(app.codeGenType || '') }}
    </a-tag>
    
    <a-tag v-if="showPriority && app.priority > 0" color="orange">
      <template #icon><StarOutlined /></template>
      精选应用
    </a-tag>

    <a-tag v-if="showDeploy && app.deployKey" color="green">
      <template #icon><RocketOutlined /></template>
      已部署
    </a-tag>
    
    <a-tag v-if="showDeploy && !app.deployKey" color="default">
      未部署
    </a-tag>
  </div>
</template>

<script setup lang="ts">
import { StarOutlined, RocketOutlined } from '@ant-design/icons-vue'
import { getCodeGenTypeName } from '@/constants/codeGenType'

interface Props {
  app: any
  showType?: boolean
  showPriority?: boolean
  showDeploy?: boolean
}

withDefaults(defineProps<Props>(), {
  showType: true,
  showPriority: true,
  showDeploy: true
})

const getTypeColor = (type?: string) => {
  const colorMap: Record<string, string> = {
    html: 'orange',
    multi_file: 'blue'
  }
  return colorMap[type || ''] || 'default'
}
</script>

<style scoped>
.app-status-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
</style>
